package bma.common.thrift.xdom;

import org.apache.thrift.protocol.TType;

public class DynamicThriftUtil {

	public static byte ttype(String type) {
		if (type == null)
			return TType.VOID;
		if (type.equals("void"))
			return TType.VOID;
		if (type.equals("bool"))
			return TType.BYTE;
		if (type.equals("double"))
			return TType.DOUBLE;
		if (type.equals("i16"))
			return TType.I16;
		if (type.equals("i32"))
			return TType.I32;
		if (type.equals("i64"))
			return TType.I64;
		if (type.equals("string"))
			return TType.STRING;
		if (type.equals("map"))
			return TType.MAP;
		if (type.equals("set"))
			return TType.SET;
		if (type.equals("list"))
			return TType.LIST;
		return TType.STOP;
	}
}
